Skip to content

Improve handling LDBODY array sizes in tests - #321

Merged
avalentino merged 1 commit into
liberfa:mainfrom
eerovaher:LDBODY-array-sizes-in-tests
Aug 19, 2026
Merged

Improve handling LDBODY array sizes in tests#321
avalentino merged 1 commit into
liberfa:mainfrom
eerovaher:LDBODY-array-sizes-in-tests

Conversation

@eerovaher

Copy link
Copy Markdown
Collaborator

The sizes of LDBODY arrays are not known at compile-time, so ERFA C functions require the size to be passed as a separate argument. The ufunc wrappers can look up array sizes at runtime, so they do not have that argument. Therefore, when erfa_generator translates ERFA C tests to Python the array size arguments must be removed. On current main this is done by replacing sub-strings in the C source code, but that requires making assumptions about variable names and literal values. In this PR the removal is performed without those assumptions.

The sizes of LDBODY arrays are not known at compile-time, so ERFA C
functions require the size to be passed as a separate argument. The
ufunc wrappers can look up array sizes at runtime, so they do not have
that argument. Therefore, when `erfa_generator` translates ERFA C tests
to Python the array size arguments must be removed. So far that has been
done by replacing sub-strings in the C source code, but that required
making assumptions about variable names and literal values. Now the
removal is performed without those assumptions.
@avalentino
avalentino merged commit 4949015 into liberfa:main Aug 19, 2026
27 checks passed
@eerovaher
eerovaher deleted the LDBODY-array-sizes-in-tests branch August 20, 2026 18:17
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants